package qhLoading.loaders 
{
	import flash.utils.ByteArray;
	/**
	 * ...
	 * @author gcxk721
	 */
	public class DataLoader extends BaseLoader 
	{
		
		private var _data:ByteArray = null;

        public function DataLoader()
        {
            
        }

        override public function getClass() : Class
        {
            return DataLoader;
        }

        public function get bytesData() : ByteArray
        {
            return this._data;
        }

        override public function initialize(bytes : *) : void
        {
            if (!(bytes is ByteArray))
            {
                throw new Error("DataResource can only handle ByteArrays.");
            }
            this._data = bytes;
            if (resourceInfo)
            {
                resourceInfo.data = this._data;
            }
            onLoadCompleteHandler();
        }

        override protected function onContentReady(value : Object) : Boolean
        {
            return this._data != null;
        }
		
	}

}